﻿using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.ComponentModel;

namespace Songhay.Silverlight.BiggestBox.IndexPart.ViewModels
{
    using Songhay.Mvvm.ViewModels;

    /// <summary>
    /// Kenny’s Food Item
    /// </summary>
    /// <remarks>
    /// This type is based on the gallery sample “Dynamic Layout and Transitions in Blend 4”
    /// by Kenny Young, Expression Blend Architect
    /// [http://gallery.expression.microsoft.com/DynamicLayoutTrans/]
    /// </remarks>
    public class KennyFoodItemViewModel : TinyViewModelBase
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="KennyFoodItemViewModel"/> class.
        /// </summary>
        /// <remarks>
        /// For details, see
        /// “How to: Implement Property Change Notification”
        /// http://msdn.microsoft.com/en-us/library/ms743695.aspx
        /// A sample <c>set</c> block:
        /// <code>
        /// set
        /// {
        /// _myProperty = value;
        /// OnPropertyChanged("MyProperty");
        /// }
        /// </code>
        /// </remarks>
        public KennyFoodItemViewModel()
        {
            this._name = string.Empty;
            this._isLiked = false;
            this._order = 0;
        }

        /// <summary>
        /// Returns the internal name of this object
        /// for retrieval from a collection.
        /// Child classes can set this property to a new value,
        /// or override it to determine the value on-demand.
        /// </summary>
        public string Name
        {
            get { return this._name; }
            set { if(this._name != value) { this._name = value; base.RaisePropertyChanged("Name"); } }
        }

        /// <summary>
        /// Gets or sets a value indicating whether this instance is liked.
        /// </summary>
        /// <value><c>true</c> if this instance is liked; otherwise, <c>false</c>.</value>
        public bool IsLiked
        {
            get { return this._isLiked; }
            set { if(this._isLiked != value) { this._isLiked = value; base.RaisePropertyChanged("IsLiked"); } }
        }

        /// <summary>
        /// Gets or sets the order.
        /// </summary>
        /// <value>The order.</value>
        public double Order
        {
            get { return this._order; }
            set { if(this._order != value) { this._order = value; base.RaisePropertyChanged("Order"); } }
        }

        string _name;
        bool _isLiked;
        double _order;
    }
}
